package com.rykj.qxj.exception;

import com.rykj.qxj.result.ErrType;

/**
 * @Description:接口服务定义义务异常       
 * @date:   2019年3月30日 下午2:06:04  
 * @author: wangshunyi
 */
public class CoreException extends RuntimeException {

	private static final long serialVersionUID = 1L;

	private String code;// 状态码
	private String message;// 异常信息

	public CoreException() {
	}

	public CoreException(String code) {
		this(code, ErrType.getMessage(code));
	}

	public CoreException(String code, String message) {
		this.code = code;
		this.message = message;
	}

	public CoreException(ErrType type) {
		this(type.getCode(), type.getMessage());
	}

	public CoreException(ErrType type, String message) {
		this(type.getCode(), message);
	}

	public CoreException(String code, String message, Throwable cause) {
		super(message, cause);
		this.code = code;
		this.message = message;
	}

	public String getCode() {
		return code;
	}

	public void setCode(String code) {
		this.code = code;
	}

	public String getMessage() {
		return message;
	}

	public void setMessage(String msg) {
		this.message = msg;
	}

}
